package com.tpshion.cloud.auth.domain.dto;

import com.tpshion.cloud.common.support.Constants;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 更新菜单请求数据
 */
@Valid
public class UpdateMenuDto {

    @NotEmpty(message = "菜单id不能为空")
    @Size(max = 64, message = "菜单长度不能超过64")
    private String id;

    @NotEmpty(message = "菜单标题不能为空")
    @Size(max = 30, message = "菜单标题长度不能超过30")
    private String title;

    @NotEmpty(message = "菜单路由不能为空")
    @Size(max = 30, message = "菜单路由长度不能超过30")
    private String name;

    @NotEmpty(message = "系统码不能为空")
    @Pattern(regexp = Constants.ACCOUNT_REGEXP, message = "系统码格式错误")
    private String sysCode;

    private String icon;

    /**
     * 外链地址
     */
    @Pattern(regexp = Constants.URL_REGEXP, message = "URL地址不合法")
    private String outPath;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSysCode() {
        return sysCode;
    }

    public void setSysCode(String sysCode) {
        this.sysCode = sysCode;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getOutPath() {
        return outPath;
    }

    public void setOutPath(String outPath) {
        this.outPath = outPath;
    }

    @Override
    public String toString() {
        return "UpdateMenuDto{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", name='" + name + '\'' +
                ", sysCode='" + sysCode + '\'' +
                ", icon='" + icon + '\'' +
                ", outPath='" + outPath + '\'' +
                '}';
    }
}
